{% include 'QLGL/QLGL_index.html' %}

<div class="am-cf admin-main">
  {% include 'sidebar.html' %}
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">巡检业务</strong></div>
      </div>
      <div class="am-g" style="position: absolute;height: 100%;right: 0px;left: 260px;width: auto;">

        {% include 'QLGL/XJYW/QLGL_XJYW_SIDEBAR.html' %}

        <div class="am-u-sm-10" style="position: absolute;width:auto;right:0;left: 200px;overflow-y: scroll;bottom: 100px;top: 0px;">
          <div class="am-g am-margin-top am-form-group">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">维护详情</strong></div>
          </div>
          <div class="am-u-sm-12 am-u-md-12">
            <div class="am-btn-toolbar">
              <div class="am-btn-group am-btn-group-xs">
                <button style="margin: 0 5px" type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="history.go(-1);">返回</button>

              </div>
            </div>
          </div>
          <!-- <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">天气情况</strong></div> -->


          <!--中间侧块 注意下面是form表-->
          <div class="am-form-group">
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">气候：</div>
              <div class="" id=weather>

              </div>
            </div>
            <hr/>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">温度：</div>
              <div class="" id=temperature>

              </div>
            </div>
            <hr/>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">巡查内容：</div>
              <div class="am-u-sm-8 am-u-md-9" style="padding-left: 0rem;">
                <div id=checkItem>

                </div>
              </div>

            </div>
            <hr/>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">紧急程度：</div>
              <div class="" id=urgencylevel>

              </div>
            </div>

            <hr/>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">病害详情：</div>
              <div class="am-u-sm-8 am-u-md-9" style="padding-left: 0rem;">
                <div class="" id=disease>

                </div>
              </div>

            </div>
            <hr/>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">桩号位置：</div>
              <div class="" id=piledirection>

              </div>
            </div>

            <hr/>
            <div class="am-g am-margin-top am-form-group">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">备注信息：</div>
              <div class="am-u-sm-8 am-u-md-9 am-u-end" style="padding-left: 0px;">
                <div class="" id=remark>

                </div>
              </div>
            </div>
            <hr/>
            <div class="am-g am-margin-top">
              <div class="am-u-sm-4 am-u-md-3 am-text-right">媒体信息:</div>
              <div class="am-u-sm-8 am-u-md-9 am-u-end" style="padding-left: 0px;">

              </div>
            </div>
            <div class="am-g am-u-sm-centered am-u-md-centered ">
              <div class="am-u-sm-2 am-u-md-6 am-u-md-3"></div>
              <div class="am-u-sm-10 am-u-md-6 am-u-md-9 am-slider am-slider-default" data-am-flexslider id="demo-slider-0">
                <ul class="am-slides">
                  <li></li>
                </ul>
              </div>
            </div>

          </div>

        </div>
      </div>

      <div class="am-g am-margin-top am-form-group">
        <input type="hidden" name='txtTemperature' id='txtTemperature'>
        <input type="hidden" name='txtWeather' id='txtWeather'>
        <input type="hidden" name='txtTaskId' id='txtTaskId'>
        <input type="hidden" name='txtFileId' id='txtFileId'>
      </div>

    </div>
  </div>
</div>
</div>
</div>
{% include 'footer.html' %}
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/static/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/static/assets/js/amazeui.min.js"></script>
<script src="/static/assets/js/amazeui.tree.js"></script>
<script type="text/javascript" src="/static/assets/js/layer.js"></script>
<script src="/static/assets/datatables/amazeui.datatables.min.js"></script>
<script src="/static/assets/dialog/amazeui.dialog.min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/assets/css/amazeui.tree.css" />
<script src="/static/assets/js/app.js"></script>
<style type="text/css">
  .li_a {
    color: #5c5c5c;
  }
</style>
<script type="text/javascript">
  $("#collapse-nav1").addClass("am-in");
  $("#qlgl").removeClass("am-collapsed");
  $("#qlglOxjyw").css("color", "#3399CC");
  $("#qlgl").css("color", "#3399CC");
  $("#xjywOrcxc").removeClass("li_a");
  $.ajaxSetup({
      data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
    });
    var diseaseinfo = {{ diseaseinfo | safe }};
  var filelist = {{ filelist | safe }};
  var counter = 0;
  $(window).load(function() {
    init();
  });

  var addSlide = function(url) {
    counter++;
    return '<li><img style="width:600px;" src="' + url + '" />'
    // '<div class="am-slider-desc">动态插入的 slide ' + counter + '</div></li>';
  };

  var init = function() {
    //绑定数据
    var item = diseaseinfo[0];
    $('#temperature').append(item.temperature);
    $('#weather').append(item.weather);
    $('#checkItem').append(item.checkItem);
    $('#urgencylevel').append(item.urgency);
    $('#disease').append(item.disease_name);
    $('#piledirection').append(item.pile_direction + ':K' + item.pile_km + '+' + item.pile_m);
    $('#remark').append(item.remark);
    //绑定图片
    var show = $('#demo-slider-0');
    var $slider = $('#demo-slider-0');

    console.log(filelist.length);
    if(filelist.length == 0) {
      $slider.hide();
    }
    for(var i = 0; i < filelist.length; i++) {
      // show.append('<li><img src="'+ filelist[i].url +'" /></li>');

      $slider.flexslider('addSlide', addSlide(filelist[i].url))
    }
    // var count = $slider.flexslider('count');
    $slider.flexslider('removeSlide', $slider.flexslider('count'))
  }
  var AlertMSG = function(msg) {
    AMUI.dialog.alert({
      title: '错误提示',
      content: msg,
      onConfirm: function() {
        console.log('close');
      }
    });
  }
</script>

</body>

</html>